//
//  String+YMBase64.swift
//  YMToolKit
//
//  Created by YDWY on 2017/4/20.
//  Copyright © 2017年 YDWY. All rights reserved.
//

import Foundation


extension String {

    
    //编码
    var ym_base64Encode : String! {
        let  data = self.data(using: .utf8)
        

        
        return data?.base64EncodedString(options:Data.Base64EncodingOptions(rawValue: 0))
    }
    
    //解码
    var ym_base64Decode : String! {
       let  data =  Data(base64Encoded: self, options: Data.Base64DecodingOptions(rawValue:0))
        
        return String(data: data!, encoding: .utf8)
        
    }
    
    
}



